<div id="card-{{card.id}}" class="card" card-id="{{card.id}}"
     ng-class="{'new-card':card.isNew,'not-sortable': stage.archived||stage.inDoneStatus,'card-rest-days-warning-summary':card.restDays<=1&&card.restDays>0&&stage.inProcess}"
     context-menu="menuOptions" context-menu-class="thiki-menu-items">
    <div class="card-code-label" ng-if="card.code!=undefined&&card.code!=''">
        <span>{{card.code}}</span>
    </div>
    <div class="card-ico" ng-if="card.size!=undefined&&board.viewType==='sprintViewSnapshot'"
         uib-tooltip="点数 {{card.size}}" tooltip-placement="left"
         tooltip-trigger="mouseenter">
        {{card.sizeName}}
    </div>

    <div class="card-ico card-comment" ng-if="card.comments!=undefined&&card.commentsNode.comments.length>0">
        <span class="glyphicon glyphicon-comment"></span>
    </div>
    <div class="card-ico"
         ng-class="{'card-rest-days-warning':card.restDays<=1&&card.restDays>0&&stage.inProcess,'card-rest-days-expired-warning':card.restDays<0&&stage.inProcess}"
         ng-if="card.restDays!=undefined&&board.viewType==='sprintViewSnapshot'">
        <span uib-tooltip="距{{card.deadline}}还有{{card.restDays}}天" tooltip-placement="left" tooltip-trigger="mouseenter"
              ng-if="card.restDays>1&&stage.inProcess"><span
                class="glyphicon glyphicon-time"></span></span>
        <span uib-tooltip="{{card.restDays}}天后逾期" tooltip-placement="left" tooltip-trigger="mouseenter"
              ng-if="card.restDays<=1&&card.restDays>=0&&stage.inProcess"><span
                class="glyphicon glyphicon-time"></span></span>
        <span uib-tooltip="逾期{{-card.restDays}}天" tooltip-placement="left" tooltip-trigger="mouseenter"
              ng-if="card.restDays<0&&stage.inProcess"><span
                class="glyphicon glyphicon-time"></span></span>
        <span uib-tooltip="截止日期：{{card.deadline}}" tooltip-placement="left" tooltip-trigger="mouseenter"
              ng-if="!stage.inProcess"><span
                class="glyphicon glyphicon-time"></span></span>
    </div>
    <div class="card-summary" ng-click="openCardConfiguration()">
        {{card.summary}}
    </div>

    <div class="card-operations" ng-if="board.viewType==='sprintViewSnapshot'">
        <div class="child-cards"
             data-ng-model="childCards" ng-if="childCards.length>0">
            <div ng-repeat="childCard in childCards  | orderBy: 'sortNumber'| orderBy: 'creationTime'">
                <span id="{{childCard.id}}" ns-popover ns-popover-theme="ns-popover-tooltip-theme"
                      ns-popover-template="component/card/partials/child-card-popover.html"
                      ns-popover-trigger="mouseenter" ns-popover-timeout="0" ns-popover-placement="right"
                      class="glyphicon glyphicon-bookmark child-card-flag"
                      ng-class="{'child-card-flag-expired':childCard.restDays<0&&!childCard.finished,'child-card-flag-finished':childCard.finished,'child-card-flag-unfinished':!childCard.finished}"></span>
            </div>
        </div>
        <assignments isInCardConfiguration="isInCardConfiguration"></assignments>
        <card-tags-small></card-tags-small>
    </div>

    <div class="card-progress" ng-if="card.totalAcceptanceCriteriasCount>0&&board.viewType==='sprintViewSnapshot'">
        <uib-progressbar ng-repeat="n in [].constructor(card.totalAcceptanceCriteriasCount) track by $index" max="index"
                         value="$index" animate="true"
                         ng-style="{'width':calculateWidth(card.totalAcceptanceCriteriasCount)}"
                         ng-class="$index < card.finishedAcceptanceCriteriasCount?'':'process-unstart'">
        </uib-progressbar>
    </div>

    <div class="card-elapsed-days" ng-if="elapsedDays>0||isIncludHalfDay>0" uib-tooltip="该卡片历时{{card.elapsedDays}}天"
         tooltip-placement="top" tooltip-trigger="mouseenter">
        <div class="elapsed-day" ng-class="{'elapsed-in-progress':stage.inProcess}"
             ng-repeat="n in [].constructor(elapsedDays) track by $index"></div>
        <div class="elapsed-day half-day" ng-class="{'elapsed-in-progress':stage.inProcess}"
             ng-if="isIncludHalfDay"></div>
    </div>
</div>